#ifndef KPOINT_H
#define KPOINT_H
#include "lattice.h"
typedef float data;
typedef unsigned int uint;

class kpoints
{
public:
   ~kpoints(){
        if(m_data){ delete []m_data; m_data=nullptr;}
        if(points){ delete []points; points=nullptr;}
        num_k=0;
        num_b=0;
        num_s=1;
    }
    void set_Efermi();
    bool input();
    uint k_num()const {return num_k;}
    uint b_num()const {return num_b;}
    uint s_num()const {return num_s;}
    point<data> &operator[](uint i){return points[i];}
    data        &operator()(uint k,uint b,uint s){return m_data[k*num_b*num_s+b*num_s+s];}
    point<data>  operator[](uint i) const {return points[i];}
    data         operator()(uint k,uint b,uint s)const {return m_data[k*num_b*num_s+b*num_s+s];}
private:
    uint  num_k=0; //number of k space points
    uint  num_b=0; //number of bands
    uint  num_s=1; //number of spin
    point<data> *points=nullptr;
    data        *m_data=nullptr;
public:
    data  Efermi=0;
};

#endif